<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${ctx}/lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctx}/css/public.css" media="all">
    <#include "../common.ftl">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>

<div class="layui-form layuimini-form">

    <#-- 设置读者Id的隐藏域 -->
    <input type="hidden" name="id" value="${(reader.id)!}">

    <div class="layui-form-item">
        <label class="layui-form-label required">读者姓名</label>
        <div class="layui-input-block">
            <input type="text" name="readerName" lay-verify="required" lay-reqtext="用户名不能为空" placeholder="请输入用户名" value="${(reader.readerName)!}" class="layui-input">
            <tip>填写自己管理账号的名称</tip>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">性别</label>
        <div class="layui-input-block">
            <#--<input type="radio" name="sex" value="${(reader.sex)!}" title="男">
            <input type="radio" name="sex" value="${(reader.sex)!}" title="女">-->
            <input type="text" name="sex" placeholder="请输入性别" value="${(reader.sex)!}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">读者身份类型</label>
        <div class="layui-input-block">
            <input type="radio" name="readerType" value="游客" title="游客">
            <input type="radio" name="readerType" value="会员" title="会员">
<#--            <input type="text" name="readerType" lay-verify="required" lay-reqtext="读者身份类型不能为空" placeholder="读者身份类型" value="${(reader.readerType)!}" class="layui-input">-->
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">手机</label>
        <div class="layui-input-block">
            <input type="number" name="phone" lay-verify="required" lay-reqtext="手机不能为空" placeholder="请输入手机" value="${(reader.phone)!}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">家庭地址</label>
        <div class="layui-input-block">
            <input type="text" name="address" placeholder="请输入家庭地址" value="${(reader.address)!}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">身份证号</label>
        <div class="layui-input-block">
            <input type="number" name="idCard" placeholder="请输入身份证号" value="${(reader.idCard)!}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注信息</label>
        <div class="layui-input-block">
            <textarea name="remark" class="layui-textarea" placeholder="请输入备注信息"></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn" id="saveBtn">确认保存</button>
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="calcelBtn" id="calcelBtn">取消保存</button>

        </div>
    </div>
</div>

<#--  引入js页面  -->
<script src="${ctx}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/js/ww/addreader.js"></script>
<script>
layui.use(['form','jquery','table'], function () {
    const form = layui.form,
        $ = layui.jquery;
    const i = '${(reader.readerType)!}';
    console.log(i);
    $("input:radio[value='" + i + "']").prop("checked", "checked");
    form.render();
})
</script>
</body>
</html>